<?php
    require_once("../database/nodes.php");
	require_once("../messages.php");
	
	if($_POST["id"] != "NULL"){
		updateNode();
	}
	else{
		createNode();		
	}

	setFlash("Node saved.");
	
	if($_POST["id"] != "NULL"){
		header("Location: show.php?id=".$_POST["id"]);
	}
	else{
		header("Location: new.php");
	}
?>